package com.yanqu.road.server.cmd.banquet.cross;

import com.yanqu.road.pb.banquet.CrossBanquetProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.banquet.CrossBanquetMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_BANQUET_CROSS_REWARD_RESP, desc = "返回用户获得的跨服宴会奖励")
public class CrossBanquetRewardRespCmd extends AbstractCommand {


	private CrossBanquetProto.CrossBanquetGetRewardResp reqMsg;
	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		reqMsg = CrossBanquetProto.CrossBanquetGetRewardResp.parseFrom(packet.getBytes());
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		ret = CrossBanquetMgr.getRewardCrossBanquet(player,reqMsg);
	}

	@Override
	public void sendData(GamePlayer player) {
		player.sendPacket(Protocol.U_BANQUET_CROSS_GET_REWARD, reqMsg.toBuilder());
	}
}
